from .business import *
from .condition import *
from .contain import *
from .information import *
from .time import *
from .position import *


# TODO: 这些应该整合到Handler里, 对象化

def answer_end_multiple_normal(question, _user, _entity_dict):
    return ['repeat', question]


def answer_get_card(_question, user, entity_dict):
    res = solve_get_card(entity_dict, user.age, user.sex)
    return [res]


def answer_borrow_card(_question, user, _entity_dict):
    res = solve_borrow_card(user.age)
    return [res]


def answer_recommend_book(_question, user, _entity_dict):
    res = solve_recommend_book(user.age, user.sex)
    return [res]


def answer_recommend_book_other(_question, _user, _entity_dict):
    res = solve_recommend_book_other()
    return [res]


def answer_room_time(_question, _user, entity_dict):
    res = solve_room_time(entity_dict)
    return [res]


def answer_room_res_time(_question, _user, entity_dict):
    res = solve_room_res_time(entity_dict)
    return [res]


def answer_res_time(_question, _user, entity_dict):
    res = solve_res_time(entity_dict)
    return [res]


def answer_floor_room_a(_question, _user, entity_dict):
    res = solve_floor_room_a(entity_dict)
    return [res]


def answer_floor_room(_question, _user, entity_dict):
    res = solve_room_floor(entity_dict)
    return [res]


def answer_res_room(_question, _user, entity_dict):
    res = solve_res_room(entity_dict)
    return [res]


def answer_restype_room(_question, _user, entity_dict):
    res = solve_restype_room(entity_dict)
    return [res]


def answer_mul_type_room(_question, _user, entity_dict):
    res = solve_mul_type_room(entity_dict)
    return [res]


def answer_restype_area(_question, _user, entity_dict):
    res = solve_restype_area(entity_dict)
    return [res]


def answer_restype_library(_question, _user, entity_dict):
    res = solve_restype_library(entity_dict)
    return [res]


def answer_mul_type_area(_question, _user, entity_dict):
    res = solve_mul_type_area(entity_dict)
    return [res]


def answer_mul_type_library(_question, _user, entity_dict):
    res = solve_mul_type_library(entity_dict)
    return [res]


def answer_t_type_area(_question, _user, entity_dict):
    res = solve_t_type_area(entity_dict)
    return [res]


def answer_t_type_library(_question, _user, entity_dict):
    res = solve_t_type_library(entity_dict)
    return [res]


def answer_res_library(_question, _user, entity_dict):
    res = solve_res_library(entity_dict)
    return [res]


def answer_goods_library(_question, _user, entity_dict):
    res = solve_goods_library(entity_dict)
    return [res]


def answer_res_floor(_question, _user, entity_dict):
    res = solve_res_floor(entity_dict)
    return [res]


def answer_res_floor_a(_question, _user, entity_dict):
    res = solve_res_floor_a(entity_dict)
    return [res]


def answer_room_res_a(_question, _user, entity_dict):
    res = solve_room_res_a(entity_dict)
    return [res]


def answer_room_borrow(_question, _user, entity_dict):
    res = solve_room_borrow(entity_dict)
    return [res]


def answer_res_borrow(_question, _user, entity_dict):
    res = solve_res_borrow(entity_dict)
    return [res]


def answer_room_phone(_question, _user, entity_dict):
    res = solve_room_phone(entity_dict)
    return [res]


def answer_room_describe(_question, _user, entity_dict):
    res = solve_room_describe(entity_dict)
    return [res]


def answer_res_describe(_question, _user, entity_dict):
    res = solve_res_describe(entity_dict)
    return [res]


def answer_count_res(_question, _user, entity_dict):
    res = solve_count_res(entity_dict)
    return [res]


def answer_count_restype(_question, _user, entity_dict):
    res = solve_count_restype(entity_dict)
    return [res]


def answer_count_mul_type(_question, _user, entity_dict):
    res = solve_count_mul_type(entity_dict)
    return [res]


def answer_res_res_h(_question, _user, entity_dict):
    res = solve_res_res_h(entity_dict)
    return [res]


def answer_res_res_a(_question, _user, entity_dict):
    res = solve_res_res_a(entity_dict)
    return [res]


def answer_mul_res_h(_question, _user, entity_dict):
    res = solve_mul_res_h(entity_dict)
    return [res]


def answer_mul_res_a(_question, _user, entity_dict):
    res = solve_mul_res_a(entity_dict)
    return [res]


def answer_res_res_t(_question, _user, entity_dict):
    res = solve_res_res_t(entity_dict)
    return [res]


def answer_room_card_a(_question, _user, entity_dict):
    res = solve_room_card_a(entity_dict)
    return [res]


def answer_card_yes(_question, _user, _entity_dict):
    return [solve__card_yes()]


def answer_card_no(_question, _user, _entity_dict):
    return [solve__card_no()]


def answer_card_thirteen(_question, _user, _entity_dict):
    return [solve__card_thirteen()]


def answer_card_twelve(_question, _user, _entity_dict):
    return [solve__card_twelve()]


def answer_restype_borrow(_question, _user, entity_dict):
    res = solve_restype_borrow(entity_dict)
    return [res]


def answer_mul_type_borrow(_question, _user, _entity_dict):
    # res = solve_mul_type_borrow(entity_dict)
    # return [res]
    raise NotImplementedError


def answer_restype_describe(_question, _user, entity_dict):
    res = solve_restype_describe(entity_dict)
    return [res]


def answer_mul_type_describe(_question, _user, entity_dict):
    res = solve_mul_type_describe(entity_dict)
    return [res]


def answer_count_floor(_question, _user, entity_dict):
    res = solve_count_floor(entity_dict)
    return [res]


def answer_count_floor_library(_question, _user, _entity_dict):
    res = solve_count_floor_library()
    return [res]


def answer_floor_count_room(_question, _user, entity_dict):
    res = solve_floor_count_room(entity_dict)
    return [res]


def answer_room_pos(_question, _user, entity_dict):
    res = solve_room_pos(entity_dict)
    return res


def answer_res_pos(_question, _user, entity_dict):
    res = solve_res_pos(entity_dict)
    return [res]


def answer_goods_pos(_question, _user, entity_dict):
    res = solve_goods_pos(entity_dict)
    return [res]


def answer_area_borrow(_question, _user, entity_dict):
    res = solve_area_borrow(entity_dict)
    return [res]


def answer_card_describe(_question, _user, _entity_dict):
    res = solve_card_describe()
    return [res]


def answer_finance_describe(_question, _user, _entity_dict):
    res = solve_finance_describe()
    return [res]


def answer_money_back(_question, _user, _entity_dict):
    res = solve_money_back()
    return [res]


def answer_money_back_no(_question, _user, _entity_dict):
    res = solve_money_back_no()
    return [res]


def answer_restype_pos(_question, _user, entity_dict):
    res = solve_restype_pos(entity_dict)
    return [res]


def answer_mul_type_pos(_question, _user, entity_dict):
    res = solve_mul_type_pos(entity_dict)
    return [res]


def answer_music_pos(_question, _user, _entity_dict):
    return solve_room_pos({'room': '视听阅览区'})


# def answer_music_or_movie(_question, _user, _entity_dict):
#     dict = {'room': ['视听阅览区']}
#     res = '\n视听阅览室可以欣赏电影和音乐'
#     task_position = Task_position()
#     res += solve_room_pos(dict)[0]
#     return [res]


def answer_library_describe(_question, _user, _entity_dict):
    res = solve_library_describe()
    return [res]


def answer_library_area(_question, _user, _entity_dict):
    res = solve_library_area()
    return [res]


def answer_res_read(_question, _user, entity_dict):
    res = solve_res_read(entity_dict)
    return [res]


def answer_restype_read(_question, _user, entity_dict):
    res = solve_restype_read(entity_dict)
    return [res]


def answer_service_describe(_question, _user, entity_dict):
    print('entity_dict', entity_dict)

    res = solve_service_describe(entity_dict)
    print(res)
    return [res]


def answer_task_describe(_question, _user, entity_dict):
    res = solve_task_describe(entity_dict)
    return [res]


def answer_service_pos(_question, _user, entity_dict):
    res = solve_service_pos(entity_dict)
    return [res]


def answer_task_pos(_question, _user, entity_dict):
    res = solve_task_pos(entity_dict)
    return [res]


def answer_service_time(_question, _user, entity_dict):
    res = solve_service_time(entity_dict)
    return [res]


def answer_task_time(_question, _user, entity_dict):
    res = solve_task_time(entity_dict)
    return [res]


def answer_area_time(_question, _user, entity_dict):
    res = solve_area_time(entity_dict)
    return [res]


def answer_library_time(_question, _user, entity_dict):
    res = solve_library_time(entity_dict)
    return [res]


def answer_floor_borrow(_question, _user, entity_dict):
    res = solve_floor_borrow(entity_dict)
    return [res]


def answer_library_res_a(_question, _user, _entity_dict):
    res = solve_library_res_a()
    return [res]


def answer_library_res(_question, _user, _entity_dict):
    res = solve_library_res()
    return [res]


def answer_area_res_a(_question, _user, entity_dict):
    res = solve_area_res_a(entity_dict)
    return [res]


def answer_library_phone(_question, _user, _entity_dict):
    res = solve_library_phone()
    return [res]


def answer_service_exit(_question, _user, entity_dict):
    res = solve_service_exit(entity_dict)
    return [res]


def answer_task_exit(_question, _user, entity_dict):
    res = solve_task_exit(entity_dict)
    return [res]


def answer_res_form(_question, _user, entity_dict):
    res = solve_res_form(entity_dict)
    return [res]


def answer_res_topic(_question, _user, entity_dict):
    res = solve_res_topic(entity_dict)
    return [res]


def answer_service_room_all(_question, _user, entity_dict):
    res = solve_service_room_all(entity_dict)
    return [res]


def answer_service_room_exit(_question, _user, entity_dict):
    res = solve_service_room_exit(entity_dict)
    return [res]


def answer_service_area_exit(_question, _user, entity_dict):
    res = solve_service_area_exit(entity_dict)
    return [res]


def answer_area_pos(_question, _user, entity_dict):
    res = solve_area_pos(entity_dict)
    return [res]


def answer_return_back_res(_question, _user, entity_dict):
    res = solve_return_back_res(entity_dict)
    return [res]


def answer_service_exit_all(_question, _user, _entity_dict):
    res = solve_service_exit_all()
    return [res]


def answer_service_area_all(_question, _user, entity_dict):
    res = solve_service_area_all(entity_dict)
    return [res]


def answer_open_room(_question, _user, _entity_dict):
    res = solve_open_room()
    return [res]


def answer_res_search(_question, _user, entity_dict):
    res = solve_res_search(entity_dict)
    return [res]


# 建立起任务类型到对应的函数的映射
methods = {
    'task_res_pos': answer_res_pos,
    'task_goods_pos': answer_goods_pos,
    'task_room_pos': answer_room_pos,
    'task_room_res_a_contain': answer_room_res_a,
    'task_room_time': answer_room_time,
    'task_room_res_time': answer_room_res_time,
    'task_res_time': answer_res_time,
    'task_floor_room_a_contain': answer_floor_room_a,
    'task_room_floor_contain': answer_floor_room,
    'task_res_room_contain': answer_res_room,
    'task_res_floor_contain': answer_res_floor,
    'task_floor_res_a_contain': answer_res_floor_a,
    'task_room_borrow_business': answer_room_borrow,
    'task_res_borrow_business': answer_res_borrow,
    'task_area_borrow_business': answer_area_borrow,
    'task_room_phone_information': answer_room_phone,
    'task_room_describe_information': answer_room_describe,
    'task_res_describe_information': answer_res_describe,
    'task_count_res_contain': answer_count_res,
    'task_count_restype_contain': answer_count_restype,
    'task_count_mul_type_contain': answer_count_mul_type,
    'task_res_res_h_contain': answer_res_res_h,
    'task_res_res_a_contain': answer_res_res_a,
    'task_mul_res_h_contain': answer_mul_res_h,
    'task_mul_res_a_contain': answer_mul_res_a,
    'task_res_res_t_contain': answer_res_res_t,
    'task_room_card_a_condition': answer_room_card_a,
    'task_card_yes_business': answer_card_yes,
    'task_card_no_business': answer_card_no,
    'task_card_thirteen_business': answer_card_thirteen,
    'task_card_twelve_business': answer_card_twelve,
    'task_restype_borrow_business': answer_restype_borrow,
    ###################################################
    'task_mul_type_borrow_business': answer_mul_type_borrow,
    ###################################################
    'task_restype_describe_information': answer_restype_describe,
    'task_mul_type_describe_information': answer_mul_type_describe,
    'task_count_floor_contain': answer_count_floor,
    'task_count_floor_library_contain': answer_count_floor_library,
    'task_floor_count_room_contain': answer_floor_count_room,
    'task_card_describe_information': answer_card_describe,
    'task_finance_describe_information': answer_finance_describe,
    'task_restype_pos': answer_restype_pos,
    'task_mul_type_pos': answer_mul_type_pos,
    'task_library_describe_information': answer_library_describe,
    'task_library_area_contain': answer_library_area,
    'task_res_read_business': answer_res_read,
    'task_restype_read_business': answer_restype_read,
    'task_service_describe_information': answer_service_describe,
    'task_task_describe_information': answer_task_describe,
    'task_service_pos': answer_service_pos,
    'task_task_pos': answer_task_pos,
    'task_service_time': answer_service_time,
    'task_task_time': answer_task_time,
    'task_library_time': answer_library_time,
    'task_area_time': answer_area_time,
    'task_floor_borrow_business': answer_floor_borrow,
    'task_library_res_a_contain': answer_library_res_a,
    'task_library_res_contain': answer_library_res,
    'task_area_res_a_contain': answer_area_res_a,
    'task_library_phone_information': answer_library_phone,
    'task_service_exit_contain': answer_service_exit,
    'task_task_exit_contain': answer_task_exit,
    'task_res_form_information': answer_res_form,
    'task_res_topic_information': answer_res_topic,
    ################################################
    'task_service_room_all': answer_service_room_all,
    'task_area_pos': answer_area_pos,
    'task_return_back_res_business': answer_return_back_res,
    'task_service_exit_all_contain': answer_service_exit_all,
    'task_service_area_all_contain': answer_service_area_all,
    'task_service_room_exit_contain': answer_service_room_exit,
    'task_service_area_exit_contain': answer_service_area_exit,
    'task_open_room_information': answer_open_room,
    'task_res_search_business': answer_res_search,
    'task_restype_room_contain': answer_restype_room,
    'task_restype_area_contain': answer_restype_area,
    'task_mul_type_room_contain': answer_mul_type_room,
    'task_mul_type_area_contain': answer_mul_type_area,
    'task_mul_type_library_contain': answer_mul_type_library,
    'task_restype_library_contain': answer_restype_library,
    'task_t_type_area_contain': answer_t_type_area,
    'task_t_type_library_contain': answer_t_type_library,
    'task_res_library_contain': answer_res_library,
    'task_goods_library_contain': answer_goods_library,
    'task_get_card_business': answer_get_card,
    'task_book_recommend': answer_recommend_book,
    'task_book_other_recommend': answer_recommend_book_other,
    'task_borrow_card_condition': answer_borrow_card,
    'task_end_multiple_normal': answer_end_multiple_normal,
    'task_money_back_no_business': answer_money_back_no,
    'task_money_back_business': answer_money_back,
}
